home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
QRZ! Ham Radio 1
/
QRZ Ham Radio Callsign Database - December 1993.iso
/
arrl
/
ax_25_1
< prev
next >
Wrap
Text File
|
1993-11-21
|
31KB
|
801 lines
AX25.DOC
AX.25 Amateur Packet-Radio Link-Layer Protocol
Version 2.0 October 1984
Copyright (c) 1984 by
The American Radio Relay Legue, Inc.
Blanket permission to copy this publication by end users for
noncommercial purposes is hereby granted. No part of this
work may be reproduced in any form where such copy is offered
in exchange for any payment unless written permission has first
been secured from the publisher.
2. AX.25 Link-Layer Protocol Specification
2.1 Scope and Field of Operation
In order to provide a mechanism for the reliable
transport of data between two signaling terminals, it is
necessary to define a protocol that can accept and deliver data
over a variety of types of communications links. The AX.25 Link-
Layer Protocol is designed to provide this service, independent
of any other level that may or may not exist.
This protocol conforms to ISO Recommendations 3309, 4335
(including DAD 1&2) and 6256 high-level data link control (HDLC)
and uses some terminology found in these documents. It also
conforms with ANSI X3.66, which describes ADCCP, balanced mode.
This protocol follows, in principle, the CCITT X.25
Recommendation, with the exception of an extended address field
and the addition of the Unnumbered Information (UI) frame. It
also follows the principles of CCITT Recommendation Q.921 (LAPD)
in the use of multiple links, distinguished by the address field,
on a single shared channel.
As defined, this protocol will work equally well in
either half- or full-duplex Amateur Radio environments.
This protocol has been designed to work equally well for
direct connections between two individual amateur packet-radio
stations or an individual station and a multiport controller.
This protocol allows for the establishment of more than
one link-layer connection per device, if the device is so
capable.
This protocol does not prohibit self-connections. A
self-connection is considered to be when a device establishes a
link to itself using its own address for both the source and
destination of the frame.
Most link-layer protocols assume that one primary (or
master) device (generally called a DCE, or data circuit-
terminating equipment) is connected to one or more secondary (or
slave) device(s) (usually called a DTE, or data terminating
equipment). This type of unbalanced operation is not practical
in a shared-RF Amateur Radio environment. Instead, AX.25 assumes
that both ends of the link are of the same class, thereby
eliminating the two different classes of devices. The term DXE
is used in this protocol specification to describe the balanced
2.2 Frame Structure
Link layer packet radio transmissions are sent in small
blocks of data, called frames. Each frame is made up of several
smaller groups, called fields. Fig.1 shows the three basic types
of frames. Note that the first bit to be transmitted is on the
left side.
First
Bit Sent
Flag Address Control FCS Flag
01111110 112/560 Bits 8 Bits 16 Bits 01111110
Fig. 1A -- U and S frame construction
First
Bit Sent
Flag Address Control PID Info. FCS Flag
01111110 112/560 Bits 8 Bits 8 Bits N*8 Bits 16 Bits 01111110
Fig. 1B -- Information frame construction
Each field is made up of an integral number of octets (or
bytes), and serves a specific function as outlined below.
2.2.1 Flag Field
The flag field is one octet long. Since the flag is used
to delimit frames, it occurs at both the beginning and end of
each frame. Two frames may share one flag, which would denote
the end of the first frame, and the start of the next frame. A
flag consists of a zero followed by six ones followed by another
zero, or 01111110 (7E hex). As a result of bit stuffing (see
2.2.6, below), this sequence is not allowed to occur anywhere
else inside a complete frame.
2.2.2 Address Field
The address field is used to identify both the source of
the frame and its destination. In addition, the address field
contains the command/response information and facilities for
level 2 repeater operation.
The encoding of the address field is described in 2.2.13.
The control field is used to identify the type of frame
being passed and control several attributes of the level 2
connection. It is one octet in length, and its encoding is
discussed in 2.3.2.1, below.
2.2.4 PID Field
The Protocol Identifier (PID) field shall appear in
information frames (I and UI) only. It identifies what kind of
layer 3 protocol, if any, is in use.
The PID itself is not included as part of the octet count
of the information field. The encoding of the PID is as follows:
M L
S S
B B
yy01yyyy AX.25 layer 3 implemented.
yy10yyyy AX.25 layer 3 implemented.
11001100 Internet Protocol datagram layer 3 implemented.
11001101 Address resolution protocol layer 3 implemented.
11110000 No layer 3 implemented.
11111111 Escape character. Next octet contains more Level 3
protocol information.
Where:
A y indicates all combinations used.
Note:
All forms of yy11yyyy and yy00yyyy other than those
listed above are reserved at this time for future level 3
protocols. The assignment of these formats is up to amateur
agreement. It is recommended that the creators of level 3
protocols contact the ARRL Ad Hoc Committee on Digital
Communications for suggested encodings.
2.2.5 Information Field
The information field is used to convey user data from
one end of the link to the other. I fields are allowed in only
three types of frames: the I frame, the UI frame, and the FRMR
frame. The I field can be up to 256 octets long, and shall
contain an integral number of octets. These constraints apply
prior to the insertion of zero bits as specified in 2.2.6, below.
Any information in the I field shall be passed along the link
transparently, except for the zero-bit insertion (see 2.2.6)
necessary to prevent flags from accidentally appearing in the I
2.2.6 Bit Stuffing
In order to assure that the flag bit sequence mentioned
above doesn't appear accidentally anywhere else in a frame, the
sending station shall monitor the bit sequence for a group of
five or more contiguous one bits. Any time five contiguous one
bits are sent the sending station shall insert a zero bit after
the first one bit. During frame reception, any time five
contiguous one bits are received, a zero bit immediately
following five one bits shall be discarded.
2.2.7 Frame-Check Sequence
The frame-check sequence (FCS) is a sixteen-bit number
calculated by both the sender and receiver of a frame. It is
used to insure that the frame was not corrupted by the medium
used to get the frame from the sender to the receiver. It shall
be calculated in accordance with ISO 3309 (HDLC) Recommendations.
2.2.8 Order of Bit Transmission
With the exception of the FCS field, all fields of an
AX.25 frame shall be sent with each octet's least-significant bit
first. The FCS shall be sent most-significant bit first.
2.2.9 Invalid Frames
Any frame consisting of less than 136 bits (including the
opening and closing flags), not bounded by opening and closing
flags, or not octet aligned (an integral number of octets), shall
be considered an invalid frame by the link layer. See also
2.4.4.4, below.
2.2.10 Frame Abort
If a frame must be prematurely aborted, at least fifteen
contiguous ones shall be sent with no bit stuffing added.
2.2.11 Interframe Time Fill
Whenever it is necessary for a DXE to keep its
transmitter on while not actually sending frames, the time
between frames should be filled with contiguous flags.
2.2.12 Link Channel States
Not applicable.
2.2.13 Address-Field Encoding
The address field of all frames shall be encoded with
both the destination and source amateur call signs for the frame.
Except for the Secondary Station Identifier (SSID), the address
characters only. If level 2 amateur "repeaters" are to be used,
their call signs shall also be in the address field.
The HDLC address field is extended beyond one octet by
assigning the least-significant bit of each octet to be an
"extension bit". The extension bit of each octet is set to zero,
to indicate the next octet contains more address information, or
one, to indicate this is the last octet of the HDLC address
field. To make room for this extension bit, the amateur Radio
call sign information is shifted one bit left.
2.2.13.1 Nonrepeater Address-Field Encoding
If level 2 repeaters are not being used, the address
field is encoded as shown in Fig. 2. The destination address is
the call sign and SSID of the amateur radio station to which the
frame is addressed, while the source address contains the amateur
call sign and SSID of the station that sent the frame. These
call signs are the call signs of the two ends of a level 2 AX.25
link only.
First
Octet Sent
Address Field of Frame
Destination Address Source Address
A1 A2 A3 A4 A5 A6 A7 A8 A9 A10 A11 A12 A13 A14
Fig. 2 -- Nonrepeater Address-Field Encoding
A1 through A14 are the fourteen octets that make up the
two address subfields of the address field. The destination
subaddress is seven octets long (A1 thru A7), and is sent first.
This address sequence provides the receivers of frames time to
check the destination address subfield to see if the frame is
addressed to them while the rest of the frame is being received.
The source address subfield is then sent in octets A8 through
A14. Both of these subfields are encoded in the same manner,
except that the last octet of the address field has the HDLC
address extension bit set.
There is an octet at the end of each address subfield
that contains the Secondary Station Identifier (SSID). The SSID
subfield allows an Amateur Radio operator to have more than one
packet-radio station operating under the same call sign. This is
useful when an amateur wants to put up a repeater in addition to
a regular station, for example. The C bits (see 2.4.1.2, below)
and H bit (see 2.2.13.2, below) are also contained in this octet,
along with two bits which are reserved for future use.
mode of operation.
Octet ASCII Bin.Data Hex Data
Flag 01111110 7E
A1 K 10010110 96
A2 8 01110000 70
A3 M 10011010 9A
A4 M 10011010 9A
A5 O 10011110 9E
A6 space 01000000 40
A7 SSID 11100000 E0
A8 W 10101110 AE
A9 B 10000100 84
A10 4 01100100 68
A11 J 10010100 94
A12 F 10001100 8C
A13 I 10010010 92
A14 SSID 01100001 61
Control I 00111110 3E
PID none 11110000 F0
FCS part 1 XXXXXXXX HH
FCS part 2 XXXXXXXX HH
Flag 01111110 7E
Bit position 76543210
Fig. 3A -- Nonrepeater AX.25 frame
The frame shown is an I frame, not going through a level
2 repeater, from WB4JFI (SSID=0) to K8MMO (SSID=0), with no level
3 protocol. The P/F bit is set; the receive sequence number
(N(R)) is 1; the send sequence number (N(S)) is 7.
2.2.13.1.1 Destination Subfield Encoding
Fig. 3 shows how an amateur call sign is placed in the
destination address subfield, occupying octets A1 thru A7.
Octet ASCII Bin.Data Hex Data
A1 W 10101110 AE
A2 B 10000100 84
A3 4 01101000 68
A4 J 10010100 94
A5 F 10001100 8C
A6 I 10010010 92
A7 SSID CRRSSID0
Bit Position--> 76543210
Fig. 3 -- Destination Field Encoding
Where:
1. The top octet (A1) is the first octet sent, with bit
0 of each octet being the first bit sent, and bit 7
being the last bit sent.
2. The first (low-order or bit 0) bit of each octet is
the HDLC address extension bit, which is set to zero
on all but the last octet in the address field, where
it is set to one.
3. The bits marked "r" are reserved bits. They may be
used in an agreed-upon manner in individual networks.
When not implemented, they should be set to one.
4. The bit marked "C" is used as the command/response
bit of an AX.25 frame, as outlined in 2.4.1.2 below.
5. The characters of the call sign should be standard
seven-bit ASCII (upper case only) placed in the
leftmost seven bits of the octet to make room for the
address extension bit. If the call sign contains
fewer than six characters, it should be padded with
ASCII spaces between the last call sign character and
the SSID octet.
6. The 0000 SSID is reserved for the first personal
AX.25 station. This establishes one standard SSID for
"normal" stations to use for the first station.
2.2.13.2 Level 2 Repeater-Address Encoding
If a frame is to go through level 2 amateur packet
repeater(s), there is an additional address subfield appended to
the end of the address field. This additional subfield contains
the call sign(s) of the repeater(s) to be used. This allows more
than one repeater to share the same RF channel. If this subfield
exists, the last octet of the source subfield has its address
extension bit set to zero, indicating that more address-field
data follows. The repeater-address subfield is encoded in the
same manner as the destination and source address subfields,
except for the most-significant bit in the last octet, called the
"H" bit. The H bit is used to indicate whether a frame has been
repeated or not.
In order to provide some method of indicating when a
frame has been repeated, the H bit is set to zero on frames going
to a repeater. The repeater will set the H bit to one when the
discard any frames going to the repeater (uplink frames), while
operating through a repeater. Fig. 4 shows how the repeater-
address subfield is encoded. Fig. 4A is an example of a complete
frame after being repeated.
Octet ASCII Bin.Data Hex Data
A15 W 10101110 AE
A16 B 10000100 84
A17 4 01101000 68
A18 J 10010100 94
A19 F 10001100 8C
A20 I 10010010 92
A21 SSID HRRSSID1
Bit Order --> 76543210
Fig. 4 -- Repeater-address encoding
Where:
1. The top octet is the first octet sent, with bit 0 being
sent first and bit 7 sent last of each octet.
2. As with the source and destination address subfields
discussed above, bit 0 of each octet is the HDLC address
extension bit, which is set to zero on all but the last
address octet, where it is set to one.
3. The "R" bits are reserved in the same manner as in the
source and destination subfields.
4. The "H" bit is the has-been-repeated bit. It is set to
zero whenever a frame has not been repeated, and set to
one by the repeater when the frame has been repeated.
Octet ASCII Bin.Data Hex Data
Flag 01111110 7E
A1 K 10010110 96
A2 8 01110000 70
A3 M 10011010 9A
A4 M 10011010 9A
A5 O 10011110 9E
A6 space 01000000 40
A7 SSID 11100000 E0
A8 W 10101110 AE
A9 B 10000100 84
A11 J 10010100 94
A12 F 10001100 8C
A13 I 10010010 92
A14 SSID 01100000 60
A15 W 10101110 AE
A16 B 10000100 84
A17 4 01101000 68
A18 J 10010100 94
A19 F 10001100 8C
A20 I 10010010 92
A21 SSID 11100011 E3
Control I 00111110 3F
PID none 11110000 F0
FCS part 1 XXXXXXXX HH
FCS part 2 XXXXXXXX HH
Flag 01111110 7E
Bit position 76543210
Fig. 4A -- AX.25 frame in repeater mode
The above frame is the same as Fig. 3A, except for the
addition of a repeater-address subfield (WB4JFI, SSID=1). The H
bit is set, indicating this is from the output of the repeater.
2.2.13.3 Multiple Repeater Operation
The link-layer AX.25 protocol allows operation through
more than one repeater, creating a primitive frame routing
mechanism. Up to eight repeaters may be used by extending the
repeater-address subfield. When there is more than one repeater
address, the repeater address immediately following the source
address subfield will be considered the address of the first
repeater of a multiple-repeater chain. As a frame progresses
through a chain of repeaters, each successive repeater will set
the H bit (has-been-repeated bit) in its SSID octet, indicating
that the frame has been successfully repeated through it. No
other changes to the frame are made (except for the necessary
recalculation of the FCS). The destination station can determine
the route the frame took to each it by examining the address
field.
The number of repeater addresses is variable. All but
the last repeater address will have the address extension bits of
all octets set to zero, as will all but the last octet (SSID
octet) of the last repeater address. The last octet of the last
repeater address will have the address extension bit set to one,
indicating the end of the address field.
It should be noted that various timers (see 2.4.7, below)
may have to be adjusted to accommodate the additional delays
encountered when a frame must pass through a multiple-repeater
same path before reaching the source device.
It is anticipated that multiple-repeater operation is a
temporary method of interconnecting stations over large distances
until such time that a layer 3 protocol is in use. Once this
layer 3 protocol becomes operational, repeater chaining should be
phased out.
2.3 Elements of Procedure
2.3.1
The elements of procedure are defined in terms of actions
that occur on receipt of frames.
2.3.2 Control-Field Formats and State Variables
2.3.2.1 Control-Field Formats
The control field is responsible for identifying the type
of frame being sent, and is also used to convey commands and
responses from one end of the link to the other in order to
maintain proper link control.
The control fields used in AX.25 use the CCITT X.25
control fields for balanced operation (LAPB), with an additional
control field taken from ADCCP to allow connectionless and round-
table operation.
There are three general types of AX.25 frames. They are
the Information frame (I frame), the Supervisory frame (S frame),
and the Unnumbered frame (U frame). Fig. 5 shows the basic
format of the control field associated with these types of
frames.
Control-Field Control-Field Bits
Type 7 6 5 4 3 2 1 0
I Frame N(R) P N(S) 0
S Frame N(R) P/F S S 0 1
U Frame M M M P/F M M 1 1
Fig. 5 -- Control-field formats
Where:
1. Bit 0 is the first bit sent and bit 7 is the last bit
sent of the control field.
2. N(S) is the send sequence number (bit 1 is the LSB).
LSB).
4. The "S" bits are the supervisory function bits, and
their encoding is discussed in 2.3.4.2.
5. The "M" bits are the unnumbered frame modifier bits
and their encoding is discussed in 2.3.4.3.
6. The P/F bit is the Poll/Final bit. Its function is
described in 2.3.3. The distinction between command
and response, and therefore the distinction between P
bit and F bit, is made by addressing rules discussed
in 2.4.1.2.
2.3.2.1.1 Information-Transfer Format
All I frames have bit 0 of the control field set to zero.
N(S) is the sender's send sequence number (the send sequence
number of this frame). N(R) is the sender's receive sequence
number (the sequence number of the next expected received frame).
These numbers are described in 2.3.2.4. In addition, the P/F bit
is to be used as described in 2.4.2.
2.3.2.1.2 Supervisory Format
Supervisory frames are denoted by having bit 0 of the
control field set to one, and bit 1 of the control field set to
zero. S frames provide supervisory link control such as
acknowledging or requesting retransmission of I frames, and link-
level window control. Since S frames do not have an information
field, the sender's send variable and the receiver's receive
variable are not incremented for S frames. In addition, the P/F
bit is used as described in 2.4.2.
2.3.2.1.3 Unnumbered Format
Unnumbered frames are distinguished by having both bits 0
and 1 of the control field set to one. U frames are responsible
for maintaining additional control over the link beyond what is
accomplished with S frames. They are also responsible for
establishing and terminating link connections. U frames also
allow for the transmission and reception of information outside
of the normal flow control. Some U frames may contain
information and PID fields. The P/F bit is used as described in
2.4.2.
2.3.2.2 Control-Field Parameters
2.3.2.3 Sequence Numbers
Every AX.25 I frame shall be assigned, modulo 8, a
sequential number from 0 to 7. This will allow up to seven
outstanding I frames per level 2 connection at a time.
2.3.2.4 Frame Variables and Sequence Numbers
2.3.2.4.1 Send State Variable V(S)
The send state variable is a variable that is internal to
the DXE and is never sent. It contains the next sequential
number to be assigned to the next transmitted I frame. This
variable is updated upon the transmission of each I frame.
2.3.2.4.2 Send Sequence Number N(S)
The send sequence number is found in the control field of
all I frames. It contains the sequence number of the I frame
being sent. Just prior to the transmission of the I frame, N(S)
is updated to equal the send state variable.
2.3.2.4.3 Receive State Variable V(R)
The receive state variable is a variable that is internal
to the DXE. It contains the sequence number of the next expected
received I frame. This variable is updated upon the reception of
an error-free I frame whose send sequence number equals the
present received state variable value.
2.3.2.4.4 Received Sequence Number N(R)
The received sequence number is in both I and S frames.
Prior to sending an I or S frame, this variable is updated to
equal that of the received state variable, thus implicitly
acknowledging the proper reception of all frames up to and
including N(R)-1.
2.3.3 Functions of Poll/Final (P/F) Bit
The P/F bit is used in all types of frames. It is used
in a command (poll) mode to request an immediate reply to a
frame. The reply to this poll is indicated by setting the
response (final) bit in the appropriate frame. Only one
outstanding poll condition per direction is allowed at a time.
The procedure for P/F bit operation is described in 2.4.2.
2.3.4 Control Field Coding for Commands and Responses
The following commands and responses, indicated by their
control field encoding, are to be use by the DXE:
2.3.4.1 Information Command Frame Control Field
The function of the information (I) command is to
transfer across a data link sequentially numbered frames
containing an information field.
The information-frame control field is encoded as shown
subfield to maintain control of their passage over the link-layer
connection.
Control Field Bits
7 6 5 4 3 2 1 0
N(R) P N(S) 0
Fig. 6 -- I frame control field
2.3.4.2 Supervisory Frame Control Field
The supervisory frame control fields are encoded as shown
in Fig. 7.
Control Field Bits 7 6 5 4 3 2 1 0
Receive Ready RR N(R) P/F 0 0 0 1
Receive Not Ready RNR N(R) P/F 0 1 0 1
Reject REJ N(R) P/F 1 0 0 1
Fig. 7 -- S frame control fields
The Frame identifiers:
C or SABM Layer 2 Connect Request
D or DISC Layer 2 Disconnect Request
I Information Frame
RR Receive Ready. System Ready To Receive
RNR or NR Receive Not Ready. TNC Buffer Full
RJ or REJ Reject Frame. Out of Sequence or Duplicate
FRMR Frame Reject. Fatal Error
UI Unnumbered Information Frame. "Unproto"
DM Disconnect Mode. System Busy or Disconnected.
2.3.4.2.1 Receive Ready (RR) Command and Response
Receive Ready is used to do the following:
1. to indicate that the sender of the RR is now able to
receive more I frames.
2. to acknowledge properly received I frames up to, and
including N(R)-1, and
3. to clear a previously set busy condition created by an RNR
command having been sent.
requested by sending a RR command frame with the P-bit set to
one.
2.3.4.2.2 Receive Not Ready (RNR) Command and Response
Receive Not Ready is used to indicate to the sender of I
frames that the receiving DXE is temporarily busy and cannot
accept any more I frames. Frames up to N(R)-1 are acknowledged.
Any I frames numbered N(R) and higher that might have been caught
between states and not acknowledged when the RNR command was sent
are not acknowledged.
The RNR condition can be cleared by the sending of a UA,
RR, REJ, or SABM frame.
The status of the DXE at the other end of the link can be
requested by sending a RNR command frame with the P bit set to
one.
2.3.4.2.3 Reject (REJ) Command and Response
The reject frame is used to request retransmission of I
frames starting with N(R). Any frames that were sent with a
sequence number of N(R)-1 or less are acknowledged. Additional I
frames may be appended to the retransmission of the N(R) frame if
there are any.
Only one reject frame condition is allowed in each
direction at a time. The reject condition is cleared by the
proper reception of I frames up to the I frame that caused the
reject condition to be initiated.
The status of the DXE at the other end of the link can be
requested by sending a REJ command frame with the P bit set to
one.
2.3.4.3 Unnumbered Frame Control Fields
Unnumbered frame control fields are either commands or
responses.
Fig. 8 shows the layout of U frames implemented within
this protocol.
Control Field Type Control Field Bits
7 6 5 4 3 2 1 0
Set Asynchronous Balanced Mode-SABM Cmd 0 0 1 P 1 1 1 1
Disconnect-DISC Cmd 0 1 0 P 0 0 1 1
Disconnected Mode-DM Res 0 0 0 F 1 1 1 1
Unnumbered Acknowledge-UA Res 0 1 1 F 0 0 1 1
Frame Reject-FRMR Res 1 0 0 F 0 1 1 1
Fig. 8 -- U frame control fields
2.3.4.3.1 Set Asynchronous Balanced Mode (SABM) Command
The SABM command is used to place 2 DXEs in the
asynchronous balanced mode. This is a balanced mode of operation
known as LAPB where both devices are treated as equals.
Information fields are not allowed in SABM commands. Any
outstanding I frames left when the SABM command is issued will
remain unacknowledged.
The DXE confirms reception and acceptance of a SABM
command by sending a UA response frame at the earliest
opportunity. If the DXE is not capable of accepting a SABM
command, it should respond with a DM frame if possible.
2.3.4.3.2 Disconnect (DISC) Command
The DISC command is used to terminate a link session
between two stations. No information field is permitted in a
DISC command frame.
Prior to acting on the DISC frame, the receiving DXE
confirms acceptance of the DISC by issuing a UA response frame at
its earliest opportunity. The DXE sending the DISC enters the
disconnected state when it receives the UA response.
Any unacknowledged I frames left when this command is
acted upon will remain unacknowledged.